// Created by Roman Novitsky on 29.04.2009


#region Imported Namespaces


using System;
using System.Collections.ObjectModel;


#endregion


namespace WtfManager.UIManager
{
  public class CollectionViewFiltersCollection: Collection<ICollectionViewFilter>
  {
    #region Properties/Indexers


    public Predicate<object> Predicate
    {
      get
      {
        return Filter;
      }
    }


    #endregion


    #region Methods


    private bool Filter(object item)
    {
      foreach (ICollectionViewFilter filter in this)
      {
        if (!filter.Filter(item))
        {
          return false;
        }
      }

      return true;
    }


    #endregion
  }
}